DECLARE @ed INTEGER

-- Fichier de test du sous-schema editions et des films
-- Par Bernard Pratz, Equipe IBDR Acid


-- test film.sql

EXECUTE p_display_film;
GO

PRINT ' * Deleting movie #42'
DELETE From Film WHERE isan = 42;
GO
PRINT ' * Deleting movie #69'
DELETE From Film WHERE isan = 69;
GO

EXECUTE p_display_film;
GO

EXECUTE p_new_film 42, 
            'Monty Python and the Holy Grail', 'Monty Python', '05/09/1975',
            '|Nominated for Best Dramatic Presentation at Hugo Awards,1976|',
            '|Graham,Chapman,4/10/1941,England,Actor|Terry,Jones,1/2/1942,England,Actor|Terry,Gilliam,22/11/1940,England,Actor|Terry,Gilliam,22/11/1940,England,Director|',
            '|Adventure|Epic|Comedy|Parody|'
GO

EXECUTE p_display_film;
GO

EXECUTE p_new_film 69, 
            'Monty Python: Life Of Bryan', 'Monty Python', '17/08/1979', '',
            '|Graham,Chapman,4/10/1941,England,Actor|Terry,Jones,1/2/1942,England,Actor|Terry,Jones,1/2/1942,England,Director|Terry,Gilliam,22/11/1940,England,Actor|',
            '|Adventure|Epic|Comedy|Parody|'
GO

EXECUTE p_display_film;
GO

EXECUTE p_display_crew_by_film 42
GO

EXECUTE p_display_genre_by_film 42
GO

-- test edition.sql


EXECUTE p_new_film 42, 'Monty Python and the Holy Grail', 'Monty Python', '05/09/1975', '|Nominated for Best Dramatic Presentation at Hugo Awards,1976|', '|Graham,Chapman,4/10/1941,England,Actor|Terry,Jones,1/2/1942,England,Actor|Terry,Gilliam,22/11/1940,England,Actor|Terry,Gilliam,22/11/1940,England,Director|', '|Adventure|Epic|Comedy|Parody|'
GO

EXECUTE p_display_film;
GO

DECLARE @ed INTEGER
EXECUTE @ed = p_add_new_edition_for_film 42, 'Blueray pirate', '15/6/2009', 
                            'super remaster reedition de la mort qui tue', 
                            '|francais,voix|anglais,voix|francais,sous-titres|anglais,sous-titres|allemand,sous-titres|italien,sous-titres|'

IF @ed <> -1
    EXECUTE p_add_new_copies_for_edition @ed, 4

GO

DECLARE @ed INTEGER
EXECUTE @ed = p_add_new_edition_for_film 42, 'VHS qui pue', '16/2/1996', 
                            'remaster', 
                            '|francais,sous-titres|anglais,sous-titres|francais,sous-titres|tcheque,voix|roumain,voix|'

IF @ed <> -1
    EXECUTE p_add_new_copy_for_edition @ed
GO

DECLARE @ed INTEGER
EXECUTE @ed = p_add_new_edition_for_film 42, 'DVD rayé', '3/7/2004', 
                            'super remaster', 
                            '|francais,voix|anglais,voix|francais,sous-titres|anglais,sous-titres|allemand,sous-titres|'

IF @ed <> -1
    EXECUTE p_add_new_copy_for_edition @ed
GO

-- removing test tuples

PRINT ' * Deleting movie #42'
DELETE From Film WHERE isan = 42;
GO
PRINT ' * Deleting movie #69'
DELETE From Film WHERE isan = 69;
GO

